//
// Fifo.hpp for  in /home/lund/Projets/pizzaillo
// 
// Made by florian dewulf
// Login   <dewulf_f@epitech.net>
// 
// Started on  Mon Apr 15 16:24:57 2013 florian dewulf
// Last update Tue Apr 16 13:45:24 2013 florian dewulf
//

#ifndef		FIFO_HPP__
# define	FIFO_HPP__

#include	<iostream>
#include	<string>
#include	<fstream>
#include	<sys/types.h>
#include	<sys/stat.h>
#include	<fcntl.h>

class		Fifo
{
public:
  Fifo(const std::string &);
  virtual	~Fifo();
  bool		getError() const;
  void		setError(bool);
  Fifo		&operator<<(const std::string &);
  Fifo		&operator>>(std::string &);
  void		close_in();
  void		close_out();
  std::string	getStr() const;
  void		open_in();
  void		open_out();

private:
  std::string	_str;
  bool		_error;
  //bool		_in_or_out;	// in = true, out = false
  std::string	_file;
  std::ifstream	_in;
  std::ofstream	_out;
};

#endif
